#include "Repr.h"
#include "IVisitor.h"

Repr::Repr(const exprTypePtr& value, int nodeId):
    exprType(nodeId),
    _value(value)
{
}
    
Repr::~Repr()
{
    
}
    
QString Repr::type() const
{
    return "Repr";
}
    

exprTypePtr Repr::value()
{
    return _value;
}

void Repr::setValue(const exprTypePtr& value)
{
    _value = value;
}

    
QString Repr::toString() const
{
    return QString("Repr[value=%1]").
                arg(_value ? _value->toString():"");
}
    
void Repr::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitRepr(node.dynamicCast<Repr>());
}
    
void Repr::traverse(IVisitor* visitor)
{
    if (_value != NULL)
        _value->accept(visitor, _value);
}